Package org.openquark.cal_Cal_Core_Prelude

Source Code of org.openquark.cal_Cal_Core_Prelude.Fst

package org.openquark.cal_Cal_Core_Prelude;

import org.openquark.cal.internal.runtime.lecc.RTExecutionContext;
import org.openquark.cal.internal.runtime.lecc.RTRecordValue;
import org.openquark.cal.internal.runtime.lecc.RTResultFunction;
import org.openquark.cal.internal.runtime.lecc.RTSupercombinator;
import org.openquark.cal.internal.runtime.lecc.RTValue;
import org.openquark.cal.runtime.CALExecutorException;

public final class Fst extends RTSupercombinator {
  /**
   * Singleton instance of this class.
   */
  public static final Fst $instance = new Fst();

  private Fst() {
  }

  public final int getArity() {
    return 1;
  }

  public final java.lang.String getModuleName() {
    return "Cal.Core.Prelude";
  }

  public final java.lang.String getUnqualifiedName() {
    return "fst";
  }

  public final java.lang.String getQualifiedName() {
    return "Cal.Core.Prelude.fst";
  }

  /**
   * f
   * This method implements the function logic of the CAL function Cal.Core.Prelude.fst
   */
  public final RTValue f(final RTResultFunction $rootNode, final RTExecutionContext $ec) throws CALExecutorException {
    // Arguments
    RTValue pair = $rootNode.getArgValue();

    // Release the fields in the root node to open them to garbage collection
    $rootNode.clearMembers();
    return f1S(RTValue.lastRef(pair.evaluate($ec), pair = null), $ec);
  }

  /**
   * f1L
   * This method implements the function logic of the CAL function Cal.Core.Prelude.fst
   */
  public final RTValue f1L(RTValue pair, RTExecutionContext $ec) throws CALExecutorException {
    return f1S(RTValue.lastRef(pair.evaluate($ec), pair = null), $ec);
  }

  /**
   * f1S
   * This method implements the function logic of the CAL function Cal.Core.Prelude.fst
   */
  public final RTValue f1S(RTValue pair, RTExecutionContext $ec) throws CALExecutorException {
    // Top level supercombinator logic
    return
      (((RTRecordValue)(java.lang.Object)
        pair.getValue())).getOrdinalFieldValue(
        1).evaluate(
        $ec);
  }

}
TOP

Related Classes of org.openquark.cal_Cal_Core_Prelude.Fst

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.